package com.cty.pojo;

import java.io.Serializable;
import java.util.List;

/**
 * @Auther: cty
 * @Date: 2020/3/28 20:33
 * @Description: Menu实体类
 * @version: 1.0
 */
public class Menu implements Serializable {  // 注意要允许序列化！（内存——>硬盘）
    private int id;  // 菜单ID
    private String name;  // 菜单名
    private int pid;  // 父菜单ID

    private Menu parent;  // 父菜单
    private List<Menu> children;  // 子菜单

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public Menu getParent() {
        return parent;
    }

    public void setParent(Menu parent) {
        this.parent = parent;
    }

    public List<Menu> getChildren() {
        return children;
    }

    public void setChildren(List<Menu> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "Menu{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", pid=" + pid +
                ", parent=" + parent +
                ", children=" + children +
                '}';
    }
}
